<?php 	
	include_once("./View/Topo.php");
?>

<nav class="navbar navbar-default" role="navigation">
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class="navbar-header">
    <div class="navbar-brand">LISTA DE GRUPO DE PRODUTOS</div>
  </div>
</nav>
					
<table class="table table-striped table-hover" width="100%" border="0">
	<tr>
		
		<th width="10%">Cód. Grupo</span></th>
		<th width="50%">Nome do Grupo</th>
		<th width="20%">Alterar</th>
		<th width="20%">Excluir</th>
	</tr>
	<?php 
		
		foreach ($this->grupos as $grupo)
		{
			echo"
				<form action='' method='POST'>
				<tr>
					<td align='center'> " . $grupo->getIdGrupo() . " </td>
					<td> " . $grupo->getNome() . " </td>
					<td align='center'> 
						<input type='hidden' name='idGrupo' value='" .$grupo->getIdGrupo(). "'/>
						<button type='submit' class='btn btn-default btn-sm'  name='metodo' value='alterar' >
						  <span class='glyphicon glyphicon-edit'></span>
						</button>
					</td>
					<td align='center'> 
						<input type='hidden' name='idGrupo' value='" .$grupo->getIdGrupo(). "'/>
						<button type='submit' class='btn btn-default btn-sm'  name='metodo' value='excluir' >
						  <span class='glyphicon glyphicon-remove-circle'></span>
						</button>
					</td>
				</tr>
				</form>";
		}				
		
	?>			
	</table>
<form>
	<div align="right">
		<input type='hidden' name='metodo' value='cadastrar'/>
		<input class="btn btn-primary" type="submit" value="Novo"/>
	</div>
</form>

<?php 
	include_once("./View/Rodape.php");
?>		